home *** CD-ROM | disk | FTP | other *** search
/ PC World 2007 December / PCWorld_2007-12_cd.bin / v cisle / fma / fma-2.1-beta-4-setup.exe / {app} / help / script56.chm / local / tooltip.htc < prev   
Text File  |  2005-12-12  |  24KB  |  765 lines

  1. <!-- ---------------------------------------------------------------------
  2. //
  3. //  Copyright 1998 Microsoft Corporation.  All Rights Reserved.
  4. //
  5. //  File:         tooltip.htc
  6. //
  7. //  Description:  This behavior allows web authors to add tooltips to any
  8. //                element on the page. Any HTML can be included in the 
  9. //                tooltip, including images and CSS formatting. Web authors
  10. //                can also control the placement and duration of the tooltip.
  11. //
  12. //-------------------------------------------------------------------- -->
  13.  
  14. <PROPERTY NAME="avoidMouse" />
  15. <PROPERTY NAME="element"    />
  16. <PROPERTY NAME="delay"      />
  17. <PROPERTY NAME="duration"   />
  18.  
  19. <METHOD   NAME="HideTip"    />
  20. <METHOD   NAME="ShowTip"    />
  21.  
  22. <EVENT    NAME="onshow"  ID="show"   />
  23. <EVENT    NAME="onhide"  ID="hide"   />
  24. <EVENT    NAME="onerror" ID="error"  />
  25.  
  26. <ATTACH   EVENT="ondocumentready" HANDLER="DoInit" />
  27.  
  28.  
  29. <SCRIPT LANGUAGE="jscript">
  30.  
  31.  
  32. //+----------------------------------------------------------------------------
  33. //
  34. //  Global Variables
  35. //
  36. //-----------------------------------------------------------------------------
  37.  
  38. var bShowing;       // Tracks if the tooltip is showing
  39.  
  40. var bOverTip;       // Tracks if the mouse is over the tooltip
  41.  
  42. var iOffsetX;       // Tracks the left position to show the tooltip
  43.  
  44. var iOffsetY;       // Tracks the top position to show the tooltip
  45.  
  46. var oCurrTip;       // Tracks the element that is left to move over the tooltip
  47.  
  48. var iOffsetW;        // Tracks the width of the tooltip
  49.  
  50. var iOffsetH;        // Tracks the height of the tooltip
  51.  
  52. var oTipElem;       // Tracks the element property when AttachEvent is called.
  53.                     //      This allows DetachEvent to undo the attached events
  54.                     //      If the element property is changed at runtime.
  55.  
  56. var bFixedLocation;    //Tracks is a pop-up will be in a fixed location (upper-left corner)
  57.  
  58. //+----------------------------------------------------------------------------
  59. //
  60. //  Function:       DoInit
  61. //
  62. //  Description:    Calls functions to initialize behavior.  Attaches events
  63. //                  that are not attached using the <ATTACH> element to prevent
  64. //                  firing the events until the defaults are set and the
  65. //                  behavior is initialized.
  66. //
  67. //  Arguments:      none
  68. //
  69. //  Returns:        nothing
  70. //
  71. //-----------------------------------------------------------------------------
  72.  
  73. function DoInit()
  74. {
  75.     SetDefaults();
  76.     AttachElement();
  77.     
  78.     attachEvent("onmouseover", DoMouseOverTip);
  79.     attachEvent("onmouseout", DoMouseOutTip);    
  80.     attachEvent("onpropertychange", DoPropChangeTip);
  81. }
  82.  
  83.  
  84. //+----------------------------------------------------------------------------
  85. //
  86. //  Function:       SetDefaults
  87. //
  88. //  Description:    Called during the initialization of the behavior.  Sets
  89. //                  the required settings for CSS properties and defaults for
  90. //                  regular CSS properties (the NormalDefault() function), and
  91. //                  attribute/properties.
  92. //
  93. //  Arguments:      none
  94. //
  95. //  Returns:        nothing
  96. //
  97. //-----------------------------------------------------------------------------
  98.  
  99. function SetDefaults()
  100. {
  101.     //  CSS hard-coded defaults (required settings)
  102.     style.position = "absolute";
  103.     style.visibility = "hidden";
  104.  
  105.     //  CSS Property Defaults   
  106.     NormalDefault('fontSize',        '12',              '8pt');
  107.     NormalDefault('fontFamily',      'Times New Roman', 'Arial');
  108.     NormalDefault('padding',         '0px',             '5 2 5 2');
  109.     NormalDefault('backgroundColor', 'transparent',     '#e9efff');
  110.     NormalDefault('borderStyle',     'none',            'solid');
  111.     NormalDefault('borderWidth',     'medium',          '1px');
  112.     NormalDefault('borderColor',     '#000000',         'black');
  113.     NormalDefault('color',           '#000000',         'black');
  114.     
  115.     //style.width = GetWidth();     // Set the width by calling GetWidth()
  116.     //style.height = GetHeight();   // Set the height by calling GetHeight()
  117.     
  118.     style.width = 350;    // Set the width by calling GetWidth()
  119.     style.height = 10;   // Set the height by calling GetHeight()
  120.     
  121.     style.display = "none";
  122.     style.visibility = "visible";
  123.     
  124.     iOffsetW = parseInt(style.width);
  125.     iOffsetH = parseInt(style.height);
  126.  
  127.     //  Attribute | Property Defaults
  128.     if (avoidMouse == null)     avoidMouse  = false;
  129.     if (delay == null)          delay       = 0;
  130.     if (duration == null)       duration    = 10;
  131. }
  132.  
  133.  
  134. //+----------------------------------------------------------------------------
  135. //
  136. //  Function:       NormalDefault
  137. //
  138. //  Description:    Sets the defaults for CSS properties by checking the
  139. //                  currentStyle and style of the object against the Internet Explorer
  140. //                  default.
  141. //
  142. //  Arguments:      sCSSName - the CSS name of the property
  143. //                  sIEDefault - the Internet Explorer standard default of the property
  144. //                  sDefault - the desired default of the property
  145. //
  146. //  Returns:        nothing
  147. //
  148. //-----------------------------------------------------------------------------
  149.  
  150. function NormalDefault(sCSSName, sIEDefault, sDefault)
  151. {
  152.     if (currentStyle[sCSSName] == sIEDefault 
  153.         && (style[sCSSName] == "" || style[sCSSName] == null))
  154.     {
  155.         style[sCSSName] = sDefault;
  156.     }
  157. }
  158.  
  159.  
  160. //+----------------------------------------------------------------------------
  161. //
  162. //  Function:       DoPropChangeTip
  163. //
  164. //  Description:    If the element
  165. //
  166. //  Arguments:      none
  167. //
  168. //  Returns:        nothing
  169. //
  170. //-----------------------------------------------------------------------------
  171.  
  172. function DoPropChangeTip()
  173. {
  174.     var propertyName = window.event.propertyName;
  175.  
  176.     if (propertyName == "element")
  177.     {
  178.         DetachElement();
  179.         AttachElement();
  180.     }
  181. }
  182.  
  183.  
  184. //+----------------------------------------------------------------------------
  185. //
  186. //  Function:       DoPropChangeElem
  187. //
  188. //  Description:    If the ALT or TITLE property of the element the tooltip is
  189. //                  attached to are changed, this function prevents that change
  190. //                  and fires the error event.
  191. //
  192. //  Arguments:      none
  193. //
  194. //  Returns:        nothing
  195. //
  196. //-----------------------------------------------------------------------------
  197.  
  198. function DoPropChangeElem()
  199. {
  200.     var propertyName = window.event.propertyName.toLowerCase();
  201.     var srcElement = window.event.srcElement;
  202.  
  203.     if (propertyName == "title" || propertyName == "alt")
  204.     {
  205.         //  Detach the propertychange event while the next steps are performed
  206.         srcElement.detachEvent("onpropertychange", DoPropChangeElem);
  207.         
  208.         //  Set ALT and TITLE to empty string
  209.         srcElement.title = "";
  210.         //srcElement.alt = "";
  211.         
  212.         //  Reattach the propertychange event.
  213.         srcElement.attachEvent("onpropertychange", DoPropChangeElem);
  214.     }
  215. }
  216.  
  217.  
  218. //+----------------------------------------------------------------------------
  219. //
  220. //  Function:       GetHeight
  221. //
  222. //  Description:    This function helps set the height of the tooltip, either
  223. //                  by grabbing the explicit value set on the page or by using
  224. //                  the getBoundingClientRect() method.
  225. //
  226. //  Arguments:      none
  227. //
  228. //  Returns:        currentStyle.height if currentStyle.height is not equal to
  229. //                      "auto" (which would likely signal it was not set by the
  230. //                      html page).
  231. //                  iHeight if currentStyle.height is equal to "auto".  iHeight
  232. //                      is a value based on the getBoundingClientRect() method on
  233. //                      the tooltip object.       
  234. //
  235. //-----------------------------------------------------------------------------
  236.  
  237. function GetHeight()
  238. {
  239.     if (currentStyle.height != "auto") return currentStyle.height;
  240.     
  241.     else
  242.     {
  243.         var oHeight = getBoundingClientRect();
  244.         var iHeight = oHeight.bottom - oHeight.top;
  245.  
  246.         return iHeight;
  247.     }
  248. }
  249.  
  250.  
  251. //+----------------------------------------------------------------------------
  252. //
  253. //  Function:       GetWidth
  254. //
  255. //  Description:    This function helps set the width of the tooltip, either
  256. //                  by grabbing the explicit value set on the page or by using
  257. //                  the getBoundingClientRect() method.
  258. //
  259. //  Arguments:      none
  260. //
  261. //  Returns:        currentStyle.width if currentStyle.width is not equal to
  262. //                      "auto" (which would likely signal it was not set by the
  263. //                      html page).
  264. //                  iWidth if currentStyle.width is equal to "auto".  iWidth is
  265. //                      a value based on the getBoundingClientRect() method on
  266. //                      the tooltip object.
  267. //
  268. //-----------------------------------------------------------------------------
  269.  
  270. function GetWidth()
  271. {
  272.     if (currentStyle.width != "auto") return currentStyle.width;
  273.  
  274.     else
  275.     {
  276.         var oWidth = getBoundingClientRect();
  277.         var iWidth = oWidth.right - oWidth.left;
  278.         
  279.         return iWidth;
  280.     }
  281. }
  282.  
  283.  
  284. //+----------------------------------------------------------------------------
  285. //
  286. //  Function:       DetachElement
  287. //
  288. //  Description:    Un-Attaches the events attached by AttachEvent().  This
  289. //                  function is called when the element property of the tooltip
  290. //                  is changed, so that the old element no longer calls the
  291. //                  tooltip.
  292. //
  293. //  Arguments:      none
  294. //
  295. //  Returns:        nothing
  296. //
  297. //-----------------------------------------------------------------------------
  298.  
  299. function DetachElement()
  300. {
  301.     oDetach = eval('window.document.all["' + oTipElem + '"]');
  302.     
  303.     if (oDetach.length != null && oDetach.length > 1)
  304.     {
  305.         for (i=0; i<oDetach.length; i++)
  306.         {
  307.             oDetach(i).detachEvent("onmouseover", DoMouseOverElem);
  308.             oDetach(i).detachEvent("onclick", DoMouseClickElem);
  309.             oDetach(i).detachEvent("onmouseout", DoMouseOutElem);
  310.             oDetach(i).detachEvent("onpropertychange", DoPropChangeElem);
  311.             oAttach(i).detachEvent("onkeypress", DoKeyPressElem);
  312.         }
  313.     }
  314.     
  315.     else
  316.     {
  317.         oDetach.detachEvent("onmouseover", DoMouseOverElem);
  318.         oDetach.detachEvent("onclick", DoMouseClickElem);
  319.         oDetach.detachEvent("onmouseout", DoMouseOutElem);
  320.         oDetach.detachEvent("onpropertychange", DoPropChangeElem);
  321.         oAttach.detachEvent("onkeypress", DoKeyPressElem);
  322.     }
  323. }
  324.  
  325.  
  326. //+----------------------------------------------------------------------------
  327. //
  328. //  Function:       AttachElement
  329. //
  330. //  Description:    Attaches onmouseover, onmouseout, and onproperty change
  331. //                  to the element the tooltip is assigned to (via the element
  332. //                  property).  If the element is a collection, the members
  333. //                  of the collection are enumerated.  If the element does
  334. //                  not exist, an error is returned.
  335. //
  336. //  Arguments:      none
  337. //
  338. //  Returns:        false if the element does not exist
  339. //
  340. //-----------------------------------------------------------------------------
  341.  
  342. function AttachElement()
  343. {
  344.     //
  345.     //  Set a variable equal to the object represented by the ID specified
  346.     //  in the tooltip element.
  347.     //
  348.     var oAttach = eval('window.document.all["' + element.element + '"]');
  349.  
  350.     //  If the element does not exist, return an error
  351.     if (oAttach == null)
  352.     {
  353.         return false;
  354.     }
  355.     
  356.     //
  357.     //  If the element is a collection (more than one element with the same
  358.     //  ID), the events are attached to each member of the collection.
  359.     //
  360.     else if (oAttach.length != null && oAttach.length > 1)
  361.     {
  362.         for (i=0; i<oAttach.length; i++)
  363.         {
  364.             oAttach(i).attachEvent("onmouseover", DoMouseOverElem);
  365.             oAttach(i).attachEvent("onclick", DoMouseClickElem);
  366.             oAttach(i).attachEvent("onmouseout", DoMouseOutElem);
  367.             oAttach(i).title = "";
  368.             //if (oAttach(i).tagName.toLowerCase() == "img") oAttach(i).alt = "";
  369.             oAttach(i).attachEvent("onpropertychange", DoPropChangeElem);
  370.             oAttach(i).attachEvent("onkeypress", DoKeyPressElem);
  371.         }
  372.     }
  373.     
  374.     //  Otherwise, the events are attached to the single element.
  375.     else
  376.     {
  377.         oAttach.attachEvent("onmouseover", DoMouseOverElem);
  378.         oAttach.attachEvent("onclick", DoMouseClickElem);
  379.         oAttach.attachEvent("onmouseout", DoMouseOutElem);
  380.         oAttach.title = "";
  381.         //if (oAttach.tagName.toLowerCase() == "img") oAttach.alt = "";
  382.         oAttach.attachEvent("onpropertychange", DoPropChangeElem);
  383.         oAttach.attachEvent("onkeypress", DoKeyPressElem);
  384.     }
  385.     
  386.     //  Set the variable to track the element's ID
  387.     oTipElem = element.element;
  388. }
  389.  
  390.  
  391. //+----------------------------------------------------------------------------
  392. //
  393. //  Function:       ShowTip
  394. //
  395. //  Description:    Method to show tooltip.
  396. //
  397. //  Arguments:      none
  398. //
  399. //  Returns:        false if bShowing is false (this prevents the ShowTip from
  400. //                      repeatedly being called by mousing over the element
  401. //                      and the tooltip).
  402. //
  403. //-----------------------------------------------------------------------------
  404.  
  405. function ShowTip()
  406. {
  407.     if (!bShowing) return false;
  408.     
  409.     var oBody = window.document.all["mainSection"];
  410.     
  411.     //  Make the tooltip visible
  412.     style.display = "block";
  413.     
  414.     //  Set the position of the tooltip
  415.     if(bFixedLocation)
  416.     {
  417.         style.left = iOffsetX + oBody.scrollLeft;
  418.         style.top = iOffsetY + oBody.scrollTop;
  419.     }
  420.     else
  421.     {
  422.         style.left = iOffsetX + 25;
  423.         style.top = iOffsetY + 20;
  424.         
  425.         //Check to see if the tool-tip will appear off the bottom of the screen
  426.         //and move it up if it will.
  427.         if((iOffsetY + clientHeight) > (oBody.offsetHeight + oBody.scrollTop))
  428.             style.top = iOffsetY - clientHeight;
  429.     }
  430.     
  431.     //  Fire the onshow event
  432.     show.fire();
  433.     
  434.     childNodes[0].focus();
  435.     
  436.     //  Start the timer to turn off the tooltip (call HideTip())
  437.     setTimeout(uniqueID + ".HideTip()", duration * 1000);
  438. }
  439.  
  440.  
  441. //+----------------------------------------------------------------------------
  442. //
  443. //  Function:       HideTip
  444. //
  445. //  Description:    Method to hide tooltip.
  446. //
  447. //  Arguments:      none
  448. //
  449. //  Returns:        false if the user has moved from the element to the tooltip
  450. //                      and the avoidMouse property is set to false.
  451. //
  452. //-----------------------------------------------------------------------------
  453.  
  454. function HideTip()
  455. {
  456.     if (bOverTip && (avoidMouse == "false" || avoidMouse == false)) return false;
  457.  
  458.     bShowing = false;
  459.     
  460.     //  Hide the tooltip
  461.     style.display = "none";
  462.     
  463.     //  Fire the onhide event
  464.     hide.fire();
  465. }
  466.  
  467.  
  468. //+----------------------------------------------------------------------------
  469. //
  470. //  Function:       DoMouseOverElem
  471. //
  472. //  Description:    Calls the ShowTip() methods after the delay period (set by
  473. //                  the delay property) has expired.
  474. //
  475. //  Arguments:      none
  476. //
  477. //  Returns:        false if the mouse is returning from the tooltip
  478. //
  479. //-----------------------------------------------------------------------------
  480.  
  481. function DoMouseOverElem()
  482. {
  483.     return;
  484.     /*
  485.     //  If the mouse is coming back from the tooltip, return
  486.     if (window.event.fromElement == element) return false;
  487.     
  488.     //  Base the position of the tooltip on the position of the mouse
  489.     iOffsetX = window.event.x - 10;
  490.     iOffsetY = window.event.y + 18;
  491.     
  492.     //  Set tracking variable
  493.     bShowing = true;
  494.     
  495.     //  Call ShowTip() after delay
  496.     if (delay != -1) setTimeout(uniqueID + ".ShowTip()", delay);
  497.     */
  498. }
  499.  
  500.  
  501. //+----------------------------------------------------------------------------
  502. //
  503. //  Function:       DoMouseClickElem
  504. //
  505. //  Description:    Retrieves the appropriate data and Calls the ShowTip()
  506. //                    method when a tool tip item is clicked on.
  507. //
  508. //  Arguments:      none
  509. //
  510. //  Returns:        false if the mouse is returning from the tooltip
  511. //
  512. //-----------------------------------------------------------------------------
  513.  
  514. function DoMouseClickElem()
  515. {    
  516.     //  If the mouse is coming back from the tooltip, return
  517.     if (window.event.fromElement == element) return false;
  518.     
  519.     if(element.element == 'parameterToolTip')
  520.         element.innerText = "";
  521.  
  522.     if((element.innerText == "") || (element.innerText == null))
  523.     {
  524.         if(element.element == 'parameterToolTip')
  525.         {
  526.             var DLs = window.document.all.tags("dl");
  527.             var found = false;
  528.             
  529.             if(DLs == null)
  530.                 return false;
  531.             
  532.             for(var i = 0; i < DLs.length; i++)
  533.             {
  534.                 if(DLs[i].paramName != null)
  535.                 {
  536.                     if(DLs[i].paramName == window.event.srcElement.innerHTML)
  537.                     {
  538.                         element.innerHTML = DLs[i].outerHTML;
  539.                         found = true;
  540.                     }
  541.                 }
  542.             }
  543.             if(!found)
  544.                 return false;
  545.         }
  546.         else if(element.element == 'languageFilterToolTip')
  547.         {
  548.             var languageFilterSection = window.document.all["languageSpan"];
  549.             if(languageFilterSection == null)
  550.                 return false;
  551.             element.innerHTML = languageFilterSection.innerHTML;
  552.         }
  553.         else if(element.element == 'membersOptionsFilterToolTip')
  554.         {
  555.             var membersOptionsFilterSection = window.document.all["membersOptionsSpan"];
  556.             if(membersOptionsFilterSection == null)
  557.                 return false;
  558.             element.innerHTML = membersOptionsFilterSection.innerHTML;
  559.         }
  560.         else
  561.         {
  562.             return false;
  563.         }
  564.     }
  565.     
  566.     if((element.element == 'languageFilterToolTip') || (element.element == 'membersOptionsFilterToolTip'))
  567.     {
  568.         iOffsetX = 0;
  569.         iOffsetY = window.event.srcElement.parentElement.offsetTop;
  570.         bFixedLocation = true;
  571.     }
  572.     else
  573.     {
  574.         iOffsetX = window.event.srcElement.offsetLeft;
  575.         iOffsetY = Calculate_offsetTop(window.event.srcElement);
  576.         bfixedLocation = false;
  577.     }
  578.     
  579.     //  Set tracking variable
  580.     bShowing = true;
  581.     
  582.     if(element.element == 'membersOptionsFilterToolTip')
  583.         set_protectedCheckbox();
  584.     
  585.     //  Call ShowTip() after delay
  586.     if (delay != -1) setTimeout(uniqueID + ".ShowTip()", delay);
  587. }
  588.  
  589.  
  590. //+----------------------------------------------------------------------------
  591. //
  592. //  Function:       Calculate_offsetTop
  593. //
  594. //  Description:    Calulates the combined offsetTop(s) from the souce element
  595. //                    upto the DIV tag.  This will provide the location of an
  596. //                    element on a page.
  597. //
  598. //  Arguments:      element
  599. //
  600. //  Returns:        integer of the combined offsetTop(s).
  601. //
  602. //-----------------------------------------------------------------------------
  603. function Calculate_offsetTop(e)
  604. {
  605.     if(e.tagName != 'DIV')
  606.         return e.offsetTop + Calculate_offsetTop(e.offsetParent);
  607.     else
  608.         return e.offsetTop;
  609. }
  610.  
  611.  
  612. //+----------------------------------------------------------------------------
  613. //
  614. //  Function:       set_protectedCheckbox()
  615. //
  616. //  Description:    Set the value of the protectedCheckbox based on the value of
  617. //                    the 'protectedCheckbox' variable in script.js
  618. //
  619. //-----------------------------------------------------------------------------
  620. function set_protectedCheckbox()
  621. {
  622.     if(element.element == 'membersOptionsFilterToolTip')
  623.     {    
  624.         var inputCollection = element.getElementsByTagName("input");
  625.         if(inputCollection != null)
  626.         {
  627.             for(var x = 0; x < inputCollection.length; x++)
  628.             {
  629.                 if(inputCollection[x].id == 'protectedCheckbox')
  630.                 {
  631.                     if(protectedMembers != null)
  632.                     {
  633.                         if(protectedMembers == 'on')
  634.                             inputCollection[x].checked = true;
  635.                         else
  636.                             inputCollection[x].checked = false;
  637.                     }
  638.                 }
  639.             }
  640.         }
  641.     }
  642. }
  643.  
  644. //+----------------------------------------------------------------------------
  645. //
  646. //  Function:       DoKeyPressElem
  647. //
  648. //  Description:    Calls the DoMouseClickElem() method if the ENTER key
  649. //                  was used.
  650. //
  651. //  Arguments:      none
  652. //
  653. //  Returns:        nothing
  654. //
  655. //-----------------------------------------------------------------------------
  656.  
  657. function DoKeyPressElem()
  658. {
  659.     if(window.event.keyCode == 13)
  660.         DoMouseClickElem();
  661. }
  662.  
  663. //+----------------------------------------------------------------------------
  664. //
  665. //  Function:       DoMouseOutElem
  666. //
  667. //  Description:    Calls the HideTip() method after a 200ms delay (currently
  668. //                  hard-coded).
  669. //
  670. //  Arguments:      none
  671. //
  672. //  Returns:        nothing
  673. //
  674. //-----------------------------------------------------------------------------
  675.  
  676. function DoMouseOutElem()
  677. {
  678.     //  Call HideTip after a 200ms delay
  679.     setTimeout(uniqueID + ".HideTip()", 500);
  680. }
  681.  
  682.  
  683. //+----------------------------------------------------------------------------
  684. //
  685. //  Function:       DoMouseOverTip
  686. //
  687. //  Description:    Sets the variable to track if the mouse is over the tooltip
  688. //                  itself.  This assists in the process of allowing the user
  689. //                  to mouse over the tooltip itself, in the case where it
  690. //                  contains links, etc.  Note, this function is not called if
  691. //                  the avoidMouse property is set to true.
  692. //
  693. //  Arguments:      none
  694. //
  695. //  Returns:        nothing
  696. //
  697. //-----------------------------------------------------------------------------
  698.  
  699. function DoMouseOverTip()
  700. {
  701.     oCurrTip = window.event.fromElement;    
  702.     bOverTip = true;
  703. }
  704.  
  705.  
  706. //+----------------------------------------------------------------------------
  707. //
  708. //  Function:       DoMouseOutTip
  709. //
  710. //  Description:    This function occurs on the mouseout event of the tooltip.
  711. //                  When the user mouses out of the tooltip, the HideTip()
  712. //                  method is called. As in the DoMouseOverTip() function above,
  713. //                  this function is not called if the avoidMouse Property is 
  714. //                  set to true.
  715. //
  716. //  Arguments:      none
  717. //
  718. //  Returns:        false if the srcElement is inside of the tooltip
  719. //                  false if the mouse is returning to the tip element
  720. //
  721. //-----------------------------------------------------------------------------
  722.  
  723. function DoMouseOutTip()
  724. {
  725.     //
  726.     //  If the element causing the mouseout is inside the tooltip container,
  727.     //  don't hide the tooltip
  728.     //
  729.     if (element.contains(window.event.toElement)) return false;
  730.     
  731.     //  If the mouse is returning to the tip element, don't hide the tooltip
  732.     if (window.event.toElement == oCurrTip)
  733.     {
  734.         bOverTip = false;
  735.         oCurrTip = null;
  736.         return false;
  737.     }
  738.  
  739.     bOverTip = false;
  740.     HideTip();
  741. }
  742.  
  743.  
  744. //+----------------------------------------------------------------------------
  745. //
  746. //  Function:       ReturnError
  747. //
  748. //  Description:    Fires the error event, along with a descriptive text
  749. //                  message.
  750. //
  751. //  Arguments:      sMsg - descriptive text message
  752. //
  753. //  Returns:        nothing 
  754. //
  755. //-----------------------------------------------------------------------------
  756.  
  757. function ReturnError(sMsg)
  758. {
  759.     var oEvent = createEventObject();
  760.     oEvent.setAttribute("error", sMsg);
  761.     error.fire(oEvent);
  762. }
  763.  
  764.  
  765. </SCRIPT>